<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{$Think.config.site.title} - 机柜操作日志</title>
    <meta name="keywords" content="{$Think.config.site.keywords}">
    <meta name="description" content="{$Think.config.site.description}">
    <link href="{$Think.config.site.resource_url}css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="{$Think.config.site.resource_url}css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="{$Think.config.site.resource_url}css/plugins/iCheck/custom.css" rel="stylesheet">
     <!-- Data Tables -->
    <link href="{$Think.config.site.resource_url}css/plugins/dataTables/dataTables.bootstrap.css" rel="stylesheet">
    <link href="{$Think.config.site.resource_url}css/animate.css" rel="stylesheet">
    <link href="{$Think.config.site.resource_url}css/style.css?v=4.1.0" rel="stylesheet">
</head>
<style>
    .fa{ color:#1ab394;  cursor:pointer;}
    .layer-date{ width: 240px; padding:0px 12px; position: relative; top:-10px;}
</style>
<body >
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="row">
            <div class="col-sm-12">
            <style type="text/css">.col-sm-12 label{ font-weight:300; }</style>
                <div class="ibox float-e-margins">
                    <div class="">
                        <h5>{:lang('设备操作日志')}</h5>
                    </div>
                    <div class="row ibox-title">
                    <form action="" method="post" name="payjilu">　　　　      
                        <label >{:lang('机柜ID')}:</label>
                        <label ><input type="text" class="input-sm form-control" aria-controls="" name="cabinet_id" placeholder="{:lang('输入')}{:lang('机柜号')}" value="<?php if(isset($jgid)){ echo $jgid; }?>"></label>　　
                        <label >{:lang('代理商名称')} :</label>
                        <label ><input type="text" class="input-sm form-control" aria-controls="" name="operatorname" placeholder="{:lang('输入')}{:lang('代理商名称')}" value="<?php if(isset($operatorname)){ echo $operatorname; }?>"></label>　　
                        <label >{:lang('操作模式')}: </label>
                        <label >
                            <select data-placeholder="{:lang('选择操作模式')}..." class="form-control" name="mode" >
                                <option value="">{:lang('选择操作模式')}</option>
                                <option value="1" <?php if(isset($mode)){ if($mode==1){ echo 'selected';} }?> >{:lang('用户下单')}</option>
                                <option value="2" <?php if(isset($mode)){if($mode==2){ echo 'selected';} }?>>{:lang('后台管理')}</option>
                            </select>
                        </label>　　 
                        <label >{:lang('是否成功')}: </label>
                        <label >
                            <select data-placeholder="{:lang('选择返回状态信息')}..." class="form-control" name="resstatus"  >
                                <option value="">{:lang('选择返回的状态信息')}</option>
                                <option value="1" <?php if(isset($resstatus)){ if($resstatus==1){ echo 'selected';} }?> >{:lang('成功')}</option>
                                <option value="2" <?php if(isset($resstatus)){ if($resstatus==2){ echo 'selected';} }?>>{:lang('失败')}</option>
                            </select>
                        </label>
                        <div class="col-sm-12">
                            <p>&nbsp;</p>
                           　　　<label class=""> <input class="form-control layer-date" name="starttime" id="kaishi" value="{$kaishitime ?? ''}" autocomplete="off" placeholder="{:lang('开始时间')}" onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})">　</label>
                            <label class=""><input class="form-control layer-date" value="{$jieshutime ?? ''}" name="endtime" id="jieshu" autocomplete="off" placeholder="{:lang('结束时间')}" onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})"></label>　<label><button type="submit" class="btn  btn-primary" id="btn"> {:lang('提交')}</button> </label>
                        </div>
                        
                        </form>
                    </div>
                    <div class="ibox-content">

                        <table class="table table-hover" id="listtable">
                            <thead>
                                <tr>
                                    <th>{:lang('代理商')}</th>
                                    <th>{:lang('操作人')}</th>
                                    <th>{:lang('操作模式')}</th>
                                    <th>{:lang('机柜ID')}</th>
                                    <th>{:lang('操作内容')}</th>
                                    <th>{:lang('具体内容')}</th>
                                    <th>{:lang('是否成功')}</th>
                                    <th>{:lang('返回信息')}</th>
                                    <th>{:lang('十六进制')}</th>
                                    <th>{:lang('操作终端')}</th>
                                    <th>{:lang('创建时间')}</th>
                                </tr>
                            </thead>
                            <tbody>
                            
                            {volist name="list" id="v"}
                                <tr data-id="{$v.id}">
                                    <td>
                                        {if condition="$v['oid'] eq 0"}{:lang('总管理员')}{else /} {$v.yys} {/if}
                                    </td>
                                    <td>{$v.name}</td>
                                    <td>{if condition="$v['mode'] eq 1"} {:lang('用户下单')} {else /} {:lang('后台管理')} {/if}</td>
                                    <td>{$v.cabinet_id}</td>
                                    <td>
                                        {switch name="v.operation"}
                                            {case value="1"}{:lang('弹出指定充电宝')} {/case}
                                            {case value="2"}{:lang('借电多的充电宝')} {/case}
                                            {case value="3"}{:lang('更新配置')} {/case}
                                            {case value="4"}OTA {/case}
                                            {case value="5"}{:lang('重启')} {/case}
                                            {case value="6"}{:lang('查询库存明细')} {/case}
                                            {case value="7"}{:lang('查询配置')} {/case}
                                            {case value="8"}{:lang('查询版本')} {/case}
                                            {case value="9"}{:lang('归还充电宝')} {/case}
                                            {case value="10"}{:lang('登陆')} {/case}
                                            {case value="11"}{:lang('断开连接')} {/case}
                                            {default /}{$v.operation}
                                        {/switch}
                                    </td>
                                    
                                    <td>{$v.info}</td>
                                    <td>
                                        {if condition="$v['resstatus'] eq 1"} {:lang('成功')} {else /} {:lang('失败')}  {/if}
                                    </td>
                                    <td>{$v.result}</td>
                                    <td>{$v.reshex}</td>
                                    <td>{if condition="$v['openid'] eq ''"} {:lang('电脑端')} {else /} {:lang('手机端')}  {/if}</td>
                                    <td>{$v.create_time|date="Y-m-d H:i:s",###}</td>
                                </tr> 
                            {/volist}
                            <?php if(!$list) {?>
                                  <tr>
                                        <td colspan="10">{:lang('暂无记录')}</td>
                                    </tr>  
                            <?php } ?>
                            </tbody>
                        </table>
                    </div>
                    <?php if($list){?>
                    <div class="row">
                        
                        <div class="col-sm-12 ">
                            <div class=" paging_simple_numbers text-center" id="DataTables_Table_0_paginate">
                                {$list->render()}
                                <p>{:lang('总记录')}：{$list->total()}</p>
                            </div>
                        </div>
                    </div>
                    <?php } ?>
                </div>
            </div>
        </div>
    </div>
    <!-- 全局js -->
    <script src="{$Think.config.site.resource_url}js/jquery.min.js?v=2.1.4"></script>
    <script src="{$Think.config.site.resource_url}js/bootstrap.min.js?v=3.3.6"></script>
    <!-- Peity -->
    <script src="{$Think.config.site.resource_url}js/plugins/peity/jquery.peity.min.js"></script>
    <!-- 自定义js -->
    <script src="{$Think.config.site.resource_url}js/content.js?v=1.0.0"></script>
    <!-- iCheck -->
    <script src="{$Think.config.site.resource_url}js/plugins/iCheck/icheck.min.js"></script>
    <script src="{$Think.config.site.resource_url}js/plugins/layer/layer.js"></script>
    <script src="{$Think.config.site.resource_url}js/plugins/layer/laydate/laydate.js"></script>
<script type="text/javascript">
        //外部js调用
        laydate({
            elem: '#hello', 
            //目标元素。由于laydate.js封装了一个轻量级的选择器引擎，因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
            event: 'focus' //响应事件。如果没有传入event，则按照默认的click
        });

        //日期范围限制
        var start = {
            elem: '#start',
            format: 'YYYY/MM/DD hh:mm:ss',
            min: laydate.now(), //设定最小日期为当前日期
            max: '2099-06-16 23:59:59', //最大日期
            istime: true,
            istoday: false,
            choose: function (datas) {
                end.min = datas; //开始日选好后，重置结束日的最小日期
                end.start = datas //将结束日的初始值设定为开始日
            }
        };
        var end = {
            elem: '#end',
            format: 'YYYY/MM/DD hh:mm:ss',
            min: laydate.now(),
            max: '2099-06-16 23:59:59',
            istime: true,
            istoday: false,
            choose: function (datas) {
                start.max = datas; //结束日选好后，重置开始日的最大日期
            }
        };
        laydate(start);
        laydate(end);
    </script>
</body>

</html>
